package sample.plugin.language.lua.decision;

import static sample.plugin.language.lua.LuaToken.*;

import com.rapid.api.lang.engine.highlight.decision.DecisionResult;
import com.rapid.api.lang.engine.highlight.token.TokenModel;

import io.github.rosemoe.sora.widget.schemes.EditorColorScheme;
import sample.plugin.language.base.AbstractDecision;
import sample.plugin.language.lua.LuaState;

public class LuaBasicDecision extends AbstractDecision<LuaState> {
    @Override
    public Iterable<DecisionResult> decide(TokenModel model, LuaState state) {
        switch (model.token) {
            case AND:
            case BREAK:
            case DO:
            case ELSE:
            case ELSEIF:
            case END:
            case FALSE:
            case FOR:
            case FUNCTION:
            case IF:
            case IN:
            case LOCAL:
            case NIL:
            case NOT:
            case OR:
            case REPEAT:
            case RETURN:
            case THEN:
            case TRUE:
            case UNTIL:
            case WHILE:
            case GOTO:
            case SHEBANG:
                return singleColorBold(EditorColorScheme.KEYWORD);
            case ELLIPSIS:
            case CONCAT:
            case EQ:
            case GE:
            case BIT_RTRT:
            case LE:
            case BIT_LTLT:
            case NE:
            case BIT_TILDE:
            case MINUS:
            case PLUS:
            case MULT:
            case MOD:
            case DOUBLE_DIV:
            case DIV:
            case ASSIGN:
            case GT:
            case LT:
            case LPAREN:
            case RPAREN:
            case LBRACK:
            case RBRACK:
            case LCURLY:
            case RCURLY:
            case GETN:
            case COMMA:
            case SEMI:
            case DOUBLE_COLON:
            case COLON:
            case DOT:
            case EXP:
            case BIT_AND:
            case BIT_OR:
                return singleColor(EditorColorScheme.OPERATOR);
            case STRING:
                return singleColor(EditorColorScheme.STRING);
            case NUMBER:
                return singleColor(EditorColorScheme.LITERAL);
            case REGION:
            case ENDREGION:
            case SHEBANG_CONTENT:
            case DOC_COMMENT:
            case BLOCK_COMMENT:
            case SHORT_COMMENT:
                return singleColorItalic(EditorColorScheme.COMMENT);
        }
        return refuse();
    }
}
